	<div class="left" style="background-image:url(images/tit_other.png)">
		<ul>
			<?php  
			$sql_next_nums="select count(*) from miao_cp  where nums>0  and flag=1 and   str_begintime<='$time' and str_endtime>='$time' and id!='".intval($_REQUEST['d'])."'";
			$rs_next_nums=$wpdb->get_var($sql_next_nums);
		
		$sql_next="select * from miao_cp  where nums>0   and flag=1 and  str_begintime<='$time' and str_endtime>='$time' and id!='".intval($_REQUEST['d'])."' order by id ASC  limit 6 ";
			
			$rs_next=$wpdb->get_results($sql_next);
			if($rs_next!=NULL)
			{
				foreach($rs_next as $next_v)
				{
					$id=$next_v->id;
					$subtitle=$next_v->subtitle;
					$miaoprice=$next_v->miaoprice;
					$begintime=$next_v->begintime;
					$endtime=$next_v->endtime;
					$imgpath=$next_v->imgpath;
					$nums   =  $next_v->nums;
					
					
					$sql_nums="select count(*) from users_cp where cpid='$id'  ";
					$sub_nums=$wpdb->get_var($sql_nums);
					$sub_nums=intval($nums)-intval($sub_nums);
					
					if($sub_nums>0)
					{
					
					?>
      
			<li><a href="r_detail.php?d=<?php echo $id?>"><img src="upload/hotel/<?php echo $imgpath?>" /></a></li>
            
            <?php
					}
				}
				
			}
			
			$sub_yu_nums=6-intval($rs_next_nums);
			
			$sql_yu="select * from miao_cp  where nums>0  and flag=1 and  str_begintime>='$time' and id!='".intval($_REQUEST['d'])."'   order by id ASC  limit $sub_yu_nums ";
			$rs_yu=$wpdb->get_results($sql_yu);
			if($rs_yu!=NULL)
			{
				foreach($rs_yu as $yu_v)
				{
					
					$yu_id=$yu_v->id;
					$yu_imgpath=$yu_v->imgpath;
					
					?>
                    
			<li><a href="r_detail.php?d=<?php echo $yu_id?>"><img src="upload/hotel/<?php echo $yu_imgpath?>" /></a></li>
                    <?php
				}
				
			}
			?>
		</ul>
	</div>